package com.tosmart.jorm.annotation;

import java.lang.annotation.*;

/**
 * This annotation identifies an Entity object
 * associated with a database table.
 * <p/>
 * This class is a comment tag, he incurs as a
 * Entity class JORM framework.
 * <p/>
 * Framework supports insert/update/delete/search etc,
 * All functions are targeted at Entity's.
 * <p/>
 * Let Entity Object with the database tables
 * related to each other is the basis of the
 * framework JORM
 *
 * @author tosmart@gmail.com
 * @see JormMap
 * @see JormRefer
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface JormEntity {
    /**
     * This tag specifies the database associated
     * with the Entity Class name of the table.
     *
     * If you do not specify the Entity class 'table'
     * value, JORM framework will by default use the
     * Entity class name uppercase, as the table name.
     *
     * @return The table name
     */
    String table() default "";

    /**
     * Jorm framework supports the use of optimistic
     * locking on the Entity class, use this tag to
     * provide the column name of optimistic locking
     * version field of the Entity class to the framework.
     *
     * @return the version column of the Entity
     */
    String optimisticLock() default "";
}
